import Vue from 'vue'
import Router from 'vue-router'
// import HelloWorld from '@/components/HelloWorld'
import Main from '@/modules/Main'
import BlogMenu from '@/modules/BlogMenu'
import BlogList from '@/modules/BlogList'
import BlogDetail from '@/modules/BlogDetail'
import BlogCreation from '@/modules/BlogCreation'
import MusicMain from '@/modules/MusicMain'

Vue.use(Router)

const router = new Router({
  routes: [
    {
      path: '/',
      name: 'Main',
      component: Main
    },
    {
      path: '/blog/categories',
      name: 'BlogMenu',
      component: BlogMenu
    },
    {
      path: '/blog/categories/:categoryId',
      name: 'BlogList',
      component: BlogList
    },
    {
      path: '/blog/categories/:categoryId/blogs/:blogId',
      name: 'BlogDetail',
      component: BlogDetail
    },
    {
      path: '/blog/creation',
      name: 'BlogCreation',
      component: BlogCreation
    },
    {
      path: '/music',
      name: 'MusciMenu',
      component: MusicMain
    }
  ],
  scrollBehavior (to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return { x: 0, y: 0 }
    }
  }
})

export default router
